package com.lagou.rpc.comsumer.loadbalance.impl;

import com.lagou.rpc.comsumer.client.RpcClient;
import com.lagou.rpc.comsumer.loadbalance.AbstractLoadBalance;

import java.util.List;
import java.util.Random;

public class RandomLoadBalance extends AbstractLoadBalance {
    @Override
    protected RpcClient doSelect(List<RpcClient> t) {
        Random random = new Random();
        return t.get(random.nextInt(t.size()));
    }
}
